from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
class RegisterPage():

    def __init__(self, driver):
        # self.driver = webdriver.Chrome()
        self.driver = driver


    username_loc = (By.NAME, 'username')
    email_loc = (By.NAME, 'email')
    usernametext_loc = (By.ID, 'username_notice')

    def username_input(self, username):
        self.driver.find_element(*self.username_loc).send_keys(username)
        self.driver.find_element(*self.username_loc).send_keys(Keys.TAB)

    def email_input(self, email):
        self.driver.find_element(*self.email_loc).send_keys(email)
        self.driver.find_element(*self.email_loc).send_keys(Keys.TAB)

    def get_text_from_username_input(self):
        text = self.driver.find_element(*self.usernametext_loc).text
        return text